package org.adkii.core.proxy.dynamic;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class LoginInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
        System.out.println("【日志】开始调用方法：" + method.getName());
        Object result = proxy.invokeSuper(obj, args); // 调用父类方法
        System.out.println("【日志】方法调用结束：" + method.getName());
        return result;
    }
}